package com.heima.user.controller;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.user.dto.LoginDto;
import com.heima.user.service.UserService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author dongcy
 * @date 2024/11/6 11:26
 * @description LoginController
 */
@RestController
@RequestMapping("/api/v1/login")
@RequiredArgsConstructor
public class LoginController {

    private final UserService userService;

    /**
     * 登录
     * @param request
     * @param dto
     * @return
     */
    @RequestMapping("/login_auth")
    public ResponseResult loginAuth(HttpServletRequest request, @RequestBody LoginDto dto) {
        return userService.login(dto);
    }


}
